package com.ycode.bang.anbang.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ycode.bang.anbang.R;
import com.ycode.bang.anbang.adapter.base.SolidRVBaseAdapter;
import com.ycode.bang.anbang.model.ExpressBean;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * Created by squirrel on 2016/5/16.
 */
public class NoGetGoodsAdapter extends SolidRVBaseAdapter<ExpressBean> {
    private Context mContext;
    private List<ExpressBean> list;

    private OnClickListener upLoadPhotoOnClickListener;
    private OnClickListener pushOnClickListener;
    private OnClickListener photoOnClickListener;
    public NoGetGoodsAdapter(Context context, List<ExpressBean> beans) {
        super(context, beans);
        mContext=context;
        this.list=beans;
    }

    @Override
    protected void onBindDataToView(SolidCommonViewHolder holder,final ExpressBean bean, final int postion) {
       /* 快递单号：1234567890123456789012345678901234567890*/
        TextView title=holder.getView(R.id.title);
        TextView noGetButton=holder.getView(R.id.no_get_button);
        RelativeLayout linTitle=holder.getView(R.id.lin_title);
        TextView kuaidigongsi=holder.getView(R.id.kuaidigongsi);
        TextView kuaidiyua=holder.getView(R.id.kuaidiyua);
        TextView kuaidiLianxifangshi=holder.getView(R.id.kuaidi_lianxifangshi);
        ImageView photo=holder.getView(R.id.photo);
        LinearLayout photoLayout=holder.getView(R.id.photo_layout);
        TextView expressComeTime=holder.getView(R.id.express_come_time);
        TextView qujinaren=holder.getView(R.id.qujinaren);
        TextView qujinarenLianxifangshi=holder.getView(R.id.qujinaren_lianxifangshi);
        TextView tvJieshushijian=holder.getView(R.id.tv_jieshushijian);
        TextView push=holder.getView(R.id.push);
        TextView uploadPhoto=holder.getView(R.id.upload_photo);
        TextView line=holder.getView(R.id.line);
        RelativeLayout buttonLayout=holder.getView(R.id.button_layout);
        if (upLoadPhotoOnClickListener!=null){
            uploadPhoto.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    upLoadPhotoOnClickListener.onClickListener(v,bean,postion);
                }
            });
        }
        if (pushOnClickListener!=null){
            push.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    pushOnClickListener.onClickListener(v,bean,postion);
                }
            });
        }
        if (photoOnClickListener!=null){
            photo.setOnClickListener(new View.OnClickListener(){
                @Override
                public void onClick(View v) {
                    photoOnClickListener.onClickListener(v,bean,postion);
                }
            });
        }
        int type=1;
        switch (type){
            case 1:

                break;
        }


    }

    public void setUpLoadPhotoOnClickListener(OnClickListener listener){
        this.upLoadPhotoOnClickListener=listener;
    }

    public void setPushOnClickListener(OnClickListener listener){
        this.pushOnClickListener=listener;
    }

    @Override
    public int getItemLayoutID(int viewType) {
        return R.layout.item_no_get_goods;
    }

    interface OnClickListener{
        void onClickListener(View v,ExpressBean bean,int position);
    }


}
